home *** CD-ROM | disk | FTP | other *** search
- /* setACCEPTDCC.gv V1.1 ©1995 Michael J. Pounders IRCnick=mjp */
- /* */
- /* Code cleaned up by Tau, 5-30-95 */
- /* */
- /* This program will add or remove names from the ACCEPTDCC environment */
- /* variable from within Grapevine V1.365 or higher */
- /* */
- /* RX setACCEPTDCC.rexx R/S=Remove nick NS/S= doesn't save ACCEPTDCC to */
- /* ENVARC: <nick> */
-
-
- if ~show('l','rexxdossupport.library') then
- call addlib("rexxdossupport.library",0,-30,2)
- if ~show('l','rexxdossupport.library') then
- exit 10
-
- TDCC = GetVar("ACCEPTDCC","G" )
-
- ADCC = translate(TDCC,' ','|')
-
- ADCC = translate(ADCC,'','(')
-
- ADCC = translate(ADCC,'',')')
-
- ADCC = strip(ADCC,'B')
-
- parse arg args
-
- if ~ReadArgs(args, "R/S,NS/S,Nick/A", "args.") then
- exit 10
-
- word = find(ADCC,args.Nick)
- if args.R then do
- if word > 0 then
- SDCC = delword(ADCC,word,1)
- end
- else if word = 0 then
- SDCC = ADCC args.Nick
- else
- exit 10
-
- SDCC = strip(SDCC,'B')
- SDCC = translate(SDCC,'|',' ')
- SDCC = '('SDCC')'
- SetVar("ACCEPTDCC",SDCC,"G")
-
- if 0 = args.NS then Open(ACDCC,'ENVARC:ACCEPTDCC','W') WRITECH(ACDCC,SDCC)
- if ~args.NS & open('acdcc','ENVARC:ACCEPTDCC','W') then do
- writech('acdcc',SDCC)
- close('acdcc')
- end
-